package com.qf.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 2019/11/18
 * Administrator
 * springmvc1118
 * 面向对象面向君  不负代码不负卿
 */
@Controller
public class RestController {
    //处理get请求 -从服务器获取值
    @RequestMapping( value = "/order/{id}",method = RequestMethod.GET)
    public String a1(@PathVariable("id") int uid){
        System.out.println("get-"+uid);
        return "getsuccess";
    }
    //处理post  -给服务器传值
    @RequestMapping( value = "/order/{id}",method = RequestMethod.POST)
    public String a2(@PathVariable("id") int uid){
        System.out.println("POST-"+uid);
        return "postsuccess";
    }
    //处理put -更新值
    @RequestMapping( value = "/order/{id}",method = RequestMethod.PUT)
    public String a3(@PathVariable("id") int uid){
        System.out.println("PUT-"+uid);
        return "putsuccess";
    }
    //处理delete -删除值
    @RequestMapping( value = "/order/{id}",method = RequestMethod.DELETE)
    public String a4(@PathVariable("id") int uid){
        System.out.println("DELETE-"+uid);
        return "deletesuccess";
    }
}
